package budget;
import java.util.Calendar;

import person.Customer;
import event.Event;

import model.Model;


public class Request extends Model {

	public Request(Calendar requestDate, Event event, String memo,	Customer customer) {
		super();
		this.requestDate = requestDate;
		this.event = event;
		this.memo = memo;
		this.customer = customer;
	}

	public Request(long id, Calendar requestDate, Event event, String memo, Customer customer) {
		super(id);
		this.requestDate = requestDate;
		this.event = event;
		this.memo = memo;
		this.customer = customer;
	}
	public Event getEvent() {
		return event;
	}
	public void setEvent(Event event) {
		this.event = event;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public Calendar getRequestDate() {
		return requestDate;
	}
	public void setRequestDate(Calendar requestDate) {
		this.requestDate = requestDate;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	@Override
	public String toString(){
		return "[Request: "+ this.getId()+", "+memo+", "+ event.toString()+", "+ customer.toString()+", "+ requestDate.getTime()+"]";
	}
	public boolean contains(String filter){
		String string = memo +" "+ this.getId() +" "+ requestDate;
		if(string.contains(filter) || event.contains(filter) || customer.contains(filter))
			return true;
		return false;
	}
	private Calendar requestDate;
	private Event event;
	private String memo;
	private Customer customer;
}
